{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div class=\"contentcontainer med left\" style=\"margin-left: -50px;\">\n",
    "<dl class=\"dl-horizontal\">\n",
    "  <dt>Title</dt> <dd> Raster Element</dd>\n",
    "  <dt>Dependencies</dt> <dd>Matplotlib</dd>\n",
    "  <dt>Backends</dt> <dd><a href='./Raster.ipynb'>Matplotlib</a></dd> <dd><a href='../bokeh/Raster.ipynb'>Bokeh</a></dd>\n",
    "</dl>\n",
    "</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import holoviews as hv\n",
    "hv.extension('matplotlib')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A ``Raster`` is the base class for image-like elements (namely [``Image``](./Image.ipynb), [``RGB``](./RGB.ipynb) and [``HSV``](./HSV.ipynb)), but may be used directly to visualize 2D arrays using a color map:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "xvals = np.linspace(0,4,202)\n",
    "ys,xs = np.meshgrid(xvals, -xvals[::-1])\n",
    "hv.Raster(np.sin(((ys)**3)*xs))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " The coordinate system of a ``Raster`` is the raw indexes of the underlying array, with integer values always starting from (0,0) in the top left, with default extents corresponding to the shape of the array.  For a similar element used to visualize arrays but defined in a continuous Cartesian coordinate system, use the [``Image``](./Image.ipynb) element."
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
